package Poker;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;

public class Human extends Player {

	public Human(String name)
	{
		super(name);
	}
	
	public Vector<Integer> Query()
	{
		
		System.out.println("Twoje karty to: ");
		
		for(int i = 0; i < cards.size(); ++i) 
		{
			System.out.println((i+1) + ": " + cards.get(i).toString());
		}
		System.out.println(name + " co chcesz zrobic?");
		@SuppressWarnings("resource")
		Scanner kb = new Scanner(System.in);
		int karta = 0;
		while(true)
		{
				String input = kb.next();
				if(input.length() > 4)
				{
					karta = -1;
				}
				Vector<Integer> return_list = new Vector<Integer>();
				if(input.length() == 0)
					return return_list;
				for(int i = 0; i < input.length(); ++i)
				{
					karta = (int)input.charAt(i) - 48;
					if(karta < 1 || karta > 5)
					{
						karta = -1;
						break;
					}
					return_list.add(karta);
				}
				if(karta != -1)
				return return_list;
				System.out.println("Z�a odpowiedz na zapytanie.");
		}
	}
	public void PrintChange()
	{
		System.out.println("Karty po wymianie to : ");
		int i = 1;
		for (Card x : cards)
		{
			System.out.println(i + ": " + x.toString());
			++i;
		}
	}
	@SuppressWarnings("resource")
	public boolean Entry(int entry)
	{
		String input;
		do
		{
			System.out.println("Wejsc do gry (wejsciowe: " + entry + ") t\\n");
			Scanner kb = new Scanner(System.in);
			input = kb.next();
			if(input.equals("t"))
				return true;
			else if(input.equals("n"))
				return false;
		}while (!input.equals("t")  || !input.equals("n"));
		return false;
		
	}
	
	public int Bet(int bet)
	{
		System.out.println("Aktualna stawka: " + bet + " (masz: " + (chips) + ")");
		System.out.print("Ile licytujesz? ");
		Scanner kb = new Scanner(System.in);
		String input;
		while(true)
		{
			try
			{
				input = kb.next();
				return Integer.parseInt(input);
			}
			catch (NumberFormatException e)
			{
				System.out.println("Podaj liczbe... ");
			}
		}

	}
}
